#include<iostream>
using namespace std;
int main()
{
    int a, h, b, k;
    cin >> a >> h >> b >> k;
    int tmp1 = h / b + (h % b == 0 ? 0 : 1);
    int tmp2 = k / a + (k % a == 0 ? 0 : 1);
    long long e = 0;
    if (tmp1 < tmp2)
    {
        e = 10 * b;
    }
    else if (tmp1 > tmp2)
    {
        e = 10 * a;
    }
    long long ret = min(tmp1, tmp2) * (a + b) + e;
    cout << ret;
    return 0;
}